package com.shigen.demo.controller;

import com.shigen.demo.annotation.RequestLimit;
import com.shigen.demo.bean.Result;
import com.shigen.demo.entity.FirstMenu;
import com.shigen.demo.service.IMenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "menu")
@RequestLimit(second = 5)
@Api(tags = "左侧菜单")
public class menuController {

  @Resource
  private IMenuService menuService;

  @GetMapping(value = "get")
  @ApiOperation(value = "获得全部的菜单")
  public Result<List<FirstMenu>> getAllMenus() {
    return Result.ok(menuService.getAllMenus());
  }
}
